home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
050
/
madtrb13.arc
/
MONO.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1985-05-26
|
4KB
|
87 lines
(******************************************************************************
MONO.PAS
Version 1.1
May 21, 1985
by Randy Forgaard
CompuServe 70307,521
Requires PC-DOS Turbo Pascal 2.0 or higher (tested under 2.0 and 3.0), and an
IBM-PC or 100% compatible machine. These are routines for achieving all 11 of
the text highlighting effects supported by the IBM Monochrome Display Adapter:
high-intensity, reverse-video, underlining, blinking, non-display, and their
permissible combinations. Note: These routines supercede Turbo's built-in
LowVideo and NormVideo routines.
The MonochromeVideo routine accepts both an Appearance and a HighlightSet as
arguments. The IBM Monochrome Display Adapter recognizes all
Appearance/HighlightSet combinations, except that HighIntensity has no effect
when used with BlackOnWhite, and WhiteOnWhite is not supported. Other
monochrome adapters may accept these combinations, though. The IBM Monochrome
Display itself uses the HighIntensity attribute, but some other monitors do not
have this capability.
******************************************************************************)
{Video highlighting types}
type
Appearance = (WhiteOnBlack, BlackOnWhite, UnderlinedWhiteOnBlack,
BlackOnBlack, WhiteOnWhite);
Highlight = (HighIntensity, Blink);
HighlightSet = set of Highlight;
{Causes "a" and "hs" to be the appearance and highlighting of all characters
subsequently displayed to the screen using "write" or "writeln," until this
routine is called again.}
procedure MonochromeVideo (a: Appearance; hs: HighlightSet);
const
BackgroundAttr: array[Appearance] of Byte = (0, 7, 0, 0, 7);
ForegroundAttr: array[Appearance] of Byte = (7, 0, 1, 0, 7);
var
highlightBits: Byte absolute hs;
begin
TextBackground(BackgroundAttr[a]);
TextColor(ForegroundAttr[a] + (highlightBits shl 3))
end {MonochromeVideo};
{ Example program -- remove next line to enable (a Bela Lubkin trick) }
(*
begin
ClrScr;
writeln;
writeln('All the video combinations supported by the IBM Monochrome ' +
'Adapter and Display:');
writeln;
MonochromeVideo(WhiteOnBlack, []);
writeln('Normal text');
MonochromeVideo(WhiteOnBlack, [Blink]);
writeln('Blinking text');
MonochromeVideo(WhiteOnBlack, [HighIntensity]);
writeln('High-intensity text');
MonochromeVideo(WhiteOnBlack, [Blink, HighIntensity]);
writeln('Blinking high-intensity text');
MonochromeVideo(BlackOnWhite, []);
writeln('Reverse-video text');
MonochromeVideo(BlackOnWhite, [Blink]);
writeln('Blinking reverse-video text');
MonochromeVideo(UnderlinedWhiteOnBlack, []);
writeln('Underlined text');
MonochromeVideo(UnderlinedWhiteOnBlack, [Blink]);
writeln('Blinking underlined text');
MonochromeVideo(UnderlinedWhiteOnBlack, [HighIntensity]);
writeln('High-intensity underlined text');
MonochromeVideo(UnderlinedWhiteOnBlack, [Blink, HighIntensity]);
writeln('Blinking high-intensity underlined text');
writeln;
MonochromeVideo(WhiteOnBlack, []);
writeln('The following line is black-on-black (invisible):');
MonochromeVideo(BlackOnBlack, []);
writeln('Black invisible text');
MonochromeVideo(WhiteOnBlack, []);
writeln('Tests complete.')
end.
(**)